<template>
    <div class="nav_box">
        <ul class="nav_ul">
            <li @click="toPage(item)" class="nav_list" v-for="(item,index) in getClassIfyList" :key="index">
                 {{item}}
            </li>
        </ul>
    </div>
</template>

<script>
import {mapGetters,mapActions} from 'vuex'
export default {
    name : "Nav",
    computed : {
        ...mapGetters(['getClassIfyList']) 
    },
    created(){
        this.get_nav()
    },
    methods:{
        ...mapActions(["get_nav"]),
        toPage:function(e){
            //1.跳转
            //2。显示所有这个主题中的文章列表
            this.$router.push(`/${e}`)
        }
    }
}
</script>

<style>
.nav_box{
    width: 75%;
    height: 100%;
}
.nav_ul{
    height: 100%;
    width: 100%;
    display: flex;
}
.nav_list{
    list-style: none;
    height: 100%;
    flex-shrink: 1;
    flex-grow: 1;
    flex-basis: 100px;
    text-align: center;
    line-height: 45px;
    font-size: 0.8em;
    color: white;
    letter-spacing: 0.1em;
    cursor: pointer;
}
.nav_list:hover{
    background-color: #177cb0;
}
</style>